package com.zc.mall.service;

import com.zc.mall.form.CartAddForm;
import com.zc.mall.form.CartUpdateForm;
import com.zc.mall.pojo.Cart;
import com.zc.mall.vo.CartVo;
import com.zc.mall.vo.ResponseVo;

import java.util.List;

/**
 * @author 曾川
 * @version 1.0.0
 * @ClassName ICartService.java
 * @Description 购物车接口
 * @createTime 2021年06月08日 10:26:00
 */
public interface ICartService {

    /**
     * 添加购物车
     * @param uid
     * @return
     */
    ResponseVo<CartVo> add(Integer uid, CartAddForm cartAddForm);

    /**
     * 购物车列表
     * @param uid
     * @return
     */
    ResponseVo<CartVo> list(Integer uid);

    /**
     * 购物车更新
     * @param uid
     * @param productId
     * @param form
     * @return
     */
    ResponseVo<CartVo> update(Integer uid, Integer productId, CartUpdateForm form);

    /**
     * 删除购物车里的商品
     * @param uid
     * @param productId
     * @return
     */
    ResponseVo<CartVo> delete(Integer uid, Integer productId);

    /**
     * 商品全选
     * @param uid
     * @return
     */
    ResponseVo<CartVo> selectAll(Integer uid);

    /**
     * 商品全不选
     * @param uid
     * @return
     */
    ResponseVo<CartVo> unSelectAll(Integer uid);

    /**
     * 购物车商品总数
     * @param uid
     * @return
     */
    ResponseVo<Integer> sum(Integer uid);


    List<Cart> listForCart(Integer uid);
}
